using System;
using System.Collections.Generic;
using System.Text;

namespace CommonTypes
{

    /// <summary>
    /// this is a zero functionality class and is used only as an ADAPTER (GoF)
    /// from EC4 code for fieldwithundo  decide sometime  if extened by ilias
    /// fieldwithundo and implement local undo functionality versus command 
    /// global undo functionality .
    /// </summary>

        public class FieldWithUndo
        {
            //public event FieldWithUndoChangedEventHandler Changed;

            object m_Value;
            object m_Host;

          

            public object Host
            {
                get { return m_Host; }
            }

            public object Value
            {
                get { return m_Value; }
                set
                {
                

                    m_Value = value;

                   // if (Changed != null)
                   // {
                        //FieldWithUndoChangedEventArgs args = new FieldWithUndoChangedEventArgs(oldVal, m_Value);
                        //Changed(this, args);
                   // }

                }
            }

            public FieldWithUndo(object host)
            {
              //  m_Host = host;
            }

            public void SetNewValue(object val)
            {
                if (!m_Value.Equals(val))
                {
                   // UpdateFieldValueCommandBase com = m_Host.Factory.GetNewUFWC(m_Value, val, this);

                   // com.Execute();
                    m_Value = val;
                  //  m_Host.CommandHandler.AddCommand(com);
                }
            }


        }


}
